// 确认页面
class ConfirmationPage extends JPanel {
    public ConfirmationPage(PhoneRecycleApp app) {
        setLayout(new BorderLayout());
        setBackground(new Color(245, 245, 245));
        
        // 顶部导航
        JPanel header = PhoneRecycleApp.createHeader("确认信息", PhoneRecycleApp.VALUATION_PAGE, app);
        add(header, BorderLayout.NORTH);
        
        // 内容面板
        JPanel contentPanel = new JPanel();
        contentPanel.setLayout(new BoxLayout(contentPanel, BoxLayout.Y_AXIS));
        contentPanel.setBackground(new Color(245, 245, 245));
        contentPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
        
        // 设备卡片
        JPanel deviceCard = PhoneRecycleApp.createCardPanel(null);
        
        JLabel deviceLabel = new JLabel("vivo IQOO 11Pro 16GB+512G");
        deviceLabel.setFont(new Font("Microsoft YaHei", Font.PLAIN, 14));
        deviceLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
        deviceCard.add(deviceLabel);
        
        // 价格区域
        JPanel pricePanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
        pricePanel.setBackground(Color.WHITE);
        pricePanel.setAlignmentX(Component.LEFT_ALIGNMENT);
        
        JLabel priceLabel = new JLabel("￥1519");
        priceLabel.setFont(new Font("Microsoft YaHei", Font.BOLD, 24));
        priceLabel.setForeground(new Color(255, 69, 0));
        pricePanel.add(priceLabel);
        
        deviceCard.add(pricePanel);
        contentPanel.add(deviceCard);
        contentPanel.add(Box.createVerticalStrut(10));
        
        // 地址表单
        JPanel formCard = PhoneRecycleApp.createCardPanel("确认上门信息");
        
        JLabel infoLabel = new JLabel("请核对信息，信息错误将会导致回收师无法按时上门回收");
        infoLabel.setFont(new Font("Microsoft YaHei", Font.PLAIN, 9));
        infoLabel.setForeground(new Color(245, 124, 0));
        infoLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
        formCard.add(infoLabel);
        formCard.add(Box.createVerticalStrut(10));
        
        // 表单字段
        String[][] fields = {
            {"姓名", "航宇朋友"},
            {"手机号", "191****6666"},
            {"所在地区", "辽宁省沈阳市沈北新区"},
            {"详细地址", "沈阳航空航天大学南生活区"}
        };
        
        for (String[] field : fields) {
            JPanel fieldPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
            fieldPanel.setBackground(Color.WHITE);
            fieldPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
            
            JLabel label = new JLabel(field[0] + ":");
            label.setFont(new Font("Microsoft YaHei", Font.PLAIN, 11));
            label.setPreferredSize(new Dimension(80, 30));
            
            JLabel value = new JLabel(field[1]);
            value.setFont(new Font("Microsoft YaHei", Font.PLAIN, 11));
            
            fieldPanel.add(label);
            fieldPanel.add(value);
            
            formCard.add(fieldPanel);
        }
        
        // 门牌号
        JPanel roomPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
        roomPanel.setBackground(Color.WHITE);
        roomPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
        
        JLabel roomLabel = new JLabel("门牌号:");
        roomLabel.setFont(new Font("Microsoft YaHei", Font.PLAIN, 11));
        roomLabel.setPreferredSize(new Dimension(80, 30));
        
        JTextField roomField = new JTextField("例：1号楼101室（非必填）");
        roomField.setFont(new Font("Microsoft YaHei", Font.PLAIN, 11));
        roomField.setForeground(new Color(153, 153, 153));
        roomField.setPreferredSize(new Dimension(250, 30));
        
        roomPanel.add(roomLabel);
        roomPanel.add(roomField);
        
        formCard.add(roomPanel);
        contentPanel.add(formCard);
        
        // 按钮区域
        JPanel buttonPanel = new JPanel();
        buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS));
        buttonPanel.setBackground(new Color(245, 245, 245));
        buttonPanel.setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15));
        
        JButton confirmButton = new JButton("确认回收");
        confirmButton.setFont(new Font("Microsoft YaHei", Font.PLAIN, 14));
        confirmButton.setBackground(new Color(255, 69, 0));
        confirmButton.setForeground(Color.WHITE);
        confirmButton.setPreferredSize(new Dimension(350, 50));
        confirmButton.addActionListener(e -> app.showPage(PhoneRecycleApp.SUCCESS_PAGE));
        
        buttonPanel.add(confirmButton);
        
        JScrollPane scrollPane = new JScrollPane(contentPanel);
        scrollPane.setBorder(BorderFactory.createEmptyBorder());
        add(scrollPane, BorderLayout.CENTER);
        add(buttonPanel, BorderLayout.SOUTH);
    }
}